<?php
// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------
namespace app\model\api;

use laytp\BaseModel;
use think\model\concern\SoftDelete;

class SkyGuide extends BaseModel
{
    protected $name = 'sky_guide';

    /**
     * 图鉴分类导航
     * @return SkyGuide[]|array|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function list(){
        $list = $this->where('is_show','=',1)->cache(true)->order('sort desc')->select();
        $return = [];
        foreach($list as $item){
            $return[$item['model']][] = array(
                'name' => $item['guide_name'],
                'tag'  => $item['guide_name'],
                'icon' => $item['icon']
            );
        }
        return $return;
    }
}